from utils import device,platform
from lib.clock import rtc_clock
from lib.net.index import wlan
import time

__service__ = "rtc_clock"
__description__ = "network rtc clock"


def init():
    clock = rtc_clock.clock
    if platform.is_raspberry_pico_series():
        print("reset wlan for raspberry pico")
        wlan.disconnect()
        time.sleep(6)

    clock.sync_network_time()
    device.update_boot_rtc(clock.get_datetime())

async def run():
    pass
